a command menu item More...
Public Types | |
enum | Flags { kNoFlags = 0, kDisabled = 1 << 0, kTitle = 1 << 1, kChecked = 1 << 2, kSeparator = 1 << 3 } |
Public Member Functions | |
CCommandMenuItem (UTF8StringPtr title, UTF8StringPtr keycode=0, int32_t keyModifiers=0, CBitmap *icon=0, int32_t flags=kNoFlags, CBaseObject *target=0, IdStringPtr commandCategory=0, IdStringPtr commandName=0) | |
CCommandMenuItem (UTF8StringPtr title, COptionMenu *submenu, CBitmap *icon=0, CBaseObject *target=0, IdStringPtr commandCategory=0, IdStringPtr commandName=0) | |
CCommandMenuItem (UTF8StringPtr title, int32_t tag, CBaseObject *target=0, IdStringPtr commandCategory=0, IdStringPtr commandName=0) | |
CCommandMenuItem (UTF8StringPtr title, CBaseObject *target=0, IdStringPtr commandCategory=0, IdStringPtr commandName=0) | |
CCommandMenuItem (const CCommandMenuItem &item) | |
~CCommandMenuItem () | |
CCommandMenuItem Methods | |
void | setCommandCategory (IdStringPtr category) |
IdStringPtr | getCommandCategory () const |
bool | isCommandCategory (IdStringPtr category) const |
void | setCommandName (IdStringPtr name) |
IdStringPtr | getCommandName () const |
bool | isCommandName (IdStringPtr name) const |
void | setTarget (CBaseObject *target) |
CBaseObject * | getTarget () const |
CMenuItem Methods | |
virtual void | setTitle (UTF8StringPtr title) |
set title of menu item | |
virtual void | setSubmenu (COptionMenu *submenu) |
set submenu of menu item | |
virtual void | setKey (UTF8StringPtr keyCode, int32_t keyModifiers=0) |
set keycode and key modifiers of menu item | |
virtual void | setEnabled (bool state=true) |
set menu item enabled state | |
virtual void | setChecked (bool state=true) |
set menu item checked state | |
virtual void | setIsTitle (bool state=true) |
set menu item title state | |
virtual void | setIsSeparator (bool state=true) |
set menu item separator state | |
virtual void | setIcon (CBitmap *icon) |
set menu item icon | |
virtual void | setTag (int32_t tag) |
set menu item tag | |
bool | isEnabled () const |
returns whether the item is enabled or not | |
bool | isChecked () const |
returns whether the item is checked or not | |
bool | isTitle () const |
returns whether the item is a title item or not | |
bool | isSeparator () const |
returns whether the item is a separator or not | |
UTF8StringPtr | getTitle () const |
returns the title of the item | |
int32_t | getKeyModifiers () const |
returns the key modifiers of the item | |
UTF8StringPtr | getKeycode () const |
returns the keycode of the item | |
COptionMenu * | getSubmenu () const |
returns the submenu of the item | |
CBitmap * | getIcon () const |
returns the icon of the item | |
int32_t | getTag () const |
returns the tag of the item | |
Reference Counting Methods | |
virtual void | forget () |
decrease refcount and delete object if refcount == 0 | |
virtual void | remember () |
increase refcount | |
virtual int32_t | getNbReference () const |
get refcount | |
Message Methods | |
virtual CMessageResult | notify (CBaseObject *sender, IdStringPtr message) |
Static Public Attributes | |
static IdStringPtr | kMsgMenuItemValidate = "kMsgMenuItemValidate" |
message send to the target before the item is shown | |
static IdStringPtr | kMsgMenuItemSelected = "kMsgMenuItemSelected" |
message send to the target when this item was selected | |
Protected Attributes | |
CBaseObject * | target |
char * | commandCategory |
char * | commandName |
UTF8StringBuffer | title |
UTF8StringBuffer | keycode |
COptionMenu * | submenu |
CBitmap * | icon |
int32_t | flags |
int32_t | keyModifiers |
int32_t | tag |
a command menu item
The CCommandMenuItem supports setting a category, name and a target. The target will get a notify() call before the item is displayed and after it was selected.
enum Flags [inherited] |
CCommandMenuItem | ( | UTF8StringPtr | title, | |
UTF8StringPtr | keycode = 0 , |
|||
int32_t | keyModifiers = 0 , |
|||
CBitmap * | icon = 0 , |
|||
int32_t | flags = kNoFlags , |
|||
CBaseObject * | target = 0 , |
|||
IdStringPtr | commandCategory = 0 , |
|||
IdStringPtr | commandName = 0 | |||
) |
CCommandMenuItem | ( | UTF8StringPtr | title, | |
COptionMenu * | submenu, | |||
CBitmap * | icon = 0 , |
|||
CBaseObject * | target = 0 , |
|||
IdStringPtr | commandCategory = 0 , |
|||
IdStringPtr | commandName = 0 | |||
) |
CCommandMenuItem | ( | UTF8StringPtr | title, | |
int32_t | tag, | |||
CBaseObject * | target = 0 , |
|||
IdStringPtr | commandCategory = 0 , |
|||
IdStringPtr | commandName = 0 | |||
) |
CCommandMenuItem | ( | UTF8StringPtr | title, | |
CBaseObject * | target = 0 , |
|||
IdStringPtr | commandCategory = 0 , |
|||
IdStringPtr | commandName = 0 | |||
) |
CCommandMenuItem | ( | const CCommandMenuItem & | item | ) |
~CCommandMenuItem | ( | ) |
virtual void forget | ( | ) | [inline, virtual, inherited] |
decrease refcount and delete object if refcount == 0
IdStringPtr getCommandCategory | ( | ) | const [inline] |
IdStringPtr getCommandName | ( | ) | const [inline] |
CBitmap* getIcon | ( | ) | const [inline, inherited] |
returns the icon of the item
UTF8StringPtr getKeycode | ( | ) | const [inline, inherited] |
returns the keycode of the item
int32_t getKeyModifiers | ( | ) | const [inline, inherited] |
returns the key modifiers of the item
virtual int32_t getNbReference | ( | ) | const [inline, virtual, inherited] |
get refcount
COptionMenu* getSubmenu | ( | ) | const [inline, inherited] |
returns the submenu of the item
int32_t getTag | ( | ) | const [inline, inherited] |
returns the tag of the item
CBaseObject* getTarget | ( | ) | const [inline] |
UTF8StringPtr getTitle | ( | ) | const [inline, inherited] |
returns the title of the item
bool isChecked | ( | ) | const [inline, inherited] |
returns whether the item is checked or not
bool isCommandCategory | ( | IdStringPtr | category | ) | const |
bool isCommandName | ( | IdStringPtr | name | ) | const |
bool isEnabled | ( | ) | const [inline, inherited] |
returns whether the item is enabled or not
bool isSeparator | ( | ) | const [inline, inherited] |
returns whether the item is a separator or not
bool isTitle | ( | ) | const [inline, inherited] |
returns whether the item is a title item or not
virtual CMessageResult notify | ( | CBaseObject * | sender, | |
IdStringPtr | message | |||
) | [inline, virtual, inherited] |
virtual void remember | ( | ) | [inline, virtual, inherited] |
increase refcount
void setChecked | ( | bool | state = true |
) | [virtual, inherited] |
set menu item checked state
void setCommandCategory | ( | IdStringPtr | category | ) |
void setCommandName | ( | IdStringPtr | name | ) |
void setEnabled | ( | bool | state = true |
) | [virtual, inherited] |
set menu item enabled state
void setIcon | ( | CBitmap * | icon | ) | [virtual, inherited] |
set menu item icon
void setIsSeparator | ( | bool | state = true |
) | [virtual, inherited] |
set menu item separator state
void setIsTitle | ( | bool | state = true |
) | [virtual, inherited] |
set menu item title state
void setKey | ( | UTF8StringPtr | keyCode, | |
int32_t | keyModifiers = 0 | |||
) | [virtual, inherited] |
set keycode and key modifiers of menu item
void setSubmenu | ( | COptionMenu * | submenu | ) | [virtual, inherited] |
set submenu of menu item
void setTag | ( | int32_t | tag | ) | [virtual, inherited] |
set menu item tag
void setTarget | ( | CBaseObject * | target | ) |
void setTitle | ( | UTF8StringPtr | title | ) | [virtual, inherited] |
set title of menu item
char* commandCategory [protected] |
char* commandName [protected] |
int32_t flags [protected, inherited] |
UTF8StringBuffer keycode [protected, inherited] |
int32_t keyModifiers [protected, inherited] |
IdStringPtr kMsgMenuItemSelected = "kMsgMenuItemSelected" [static] |
message send to the target when this item was selected
IdStringPtr kMsgMenuItemValidate = "kMsgMenuItemValidate" [static] |
message send to the target before the item is shown
COptionMenu* submenu [protected, inherited] |
int32_t tag [protected, inherited] |
CBaseObject* target [protected] |
UTF8StringBuffer title [protected, inherited] |